package com.bzxhh.spring6.autowired.service;

import com.bzxhh.spring6.autowired.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    //注入Dao
    //第一种方式 属性注入
//    @Autowired //根据类型找到对应的对象，完成注入
//    private UserDao userDao;

    //第六种方式 两个注解 根据名称进行注入
    @Autowired
    @Qualifier(value = "userRedisDaoImpl")
    private UserDao userDao;

    @Override
    public void add() {
        System.out.println("UserServiceImpl ...");
        userDao.add();
    }
}
